package day01.比较器;

/**
 * @author feng
 * @Date 2021/10/17 16:00
 *  比较器 comparable是西安comparaTo()
 *   内部比较器的实现
 */
public class Student implements Comparable<Student> {
    private String name;
    private Integer age;
    private double height;

    public Student() {
    }

    public Student(String name, Integer age, double height) {
        this.name = name;
        this.age = age;
        this.height = height;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    @Override
    public int compareTo(Student o) {
        return ((Double)this.getHeight()).compareTo((Double)(o.getHeight()));
    }
}